/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("protobufjs/light");

var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $protobuf.Root()))
.addJSON({
  protocol: {
    options: {
      optimize_for: "SPEED",
      java_package: "com.lmxdawn.him.common.protobuf",
      java_outer_classname: "SessionProto"
    },
    nested: {
      BaseRequest: {
        oneofs: {
          body: {
            oneof: [
              "visitorLoginParam",
              "serverLoginParam"
            ]
          }
        },
        fields: {
          type: {
            type: "RequestTypeEnum",
            id: 1
          },
          visitorLoginParam: {
            type: "VisitorLoginParam",
            id: 2
          },
          serverLoginParam: {
            type: "ServerLoginParam",
            id: 3
          }
        }
      },
      RequestTypeEnum: {
        values: {
          VISITOR_LOGIN: 0,
          SERVER_LOGIN: 1,
          VISITOR_HEART_BEAT: 2
        }
      },
      VisitorLoginParam: {
        fields: {
          visitorAccid: {
            type: "string",
            id: 1
          },
          serverAccid: {
            type: "string",
            id: 2
          },
          isOffLineLogin: {
            type: "bool",
            id: 3
          },
          visitorId: {
            type: "int32",
            id: 4
          },
          serverId: {
            type: "int32",
            id: 5
          },
          companyId: {
            type: "int32",
            id: 6
          },
          lang: {
            type: "string",
            id: 7
          },
          visitorCode: {
            type: "string",
            id: 8
          }
        }
      },
      ServerLoginParam: {
        fields: {
          serverId: {
            type: "int32",
            id: 1
          },
          isOffLineLogin: {
            type: "bool",
            id: 2
          }
        }
      },
      BaseResponse: {
        oneofs: {
          body: {
            oneof: [
              "sessionResult",
              "visitorLoginResult",
              "visitorLoginOutResult"
            ]
          }
        },
        fields: {
          type: {
            type: "ResponseTypeEnum",
            id: 1
          },
          sessionResult: {
            type: "SessionResult",
            id: 2
          },
          visitorLoginResult: {
            type: "VisitorLoginResult",
            id: 3
          },
          visitorLoginOutResult: {
            type: "VisitorLoginOutResult",
            id: 4
          }
        }
      },
      ResponseTypeEnum: {
        values: {
          VISITOR_LOGIN_RESULT: 0,
          UPDATE_SESSION: 1,
          VISITOR_OFF_LINE: 2
        }
      },
      SessionResult: {
        fields: {
          id: {
            type: "int32",
            id: 1
          },
          unreadCount: {
            type: "int32",
            id: 2
          },
          message: {
            type: "string",
            id: 3
          },
          visitorId: {
            type: "int32",
            id: 4
          },
          visitorAccid: {
            type: "string",
            id: 5
          },
          nickName: {
            type: "string",
            id: 6
          },
          avatar: {
            type: "string",
            id: 7
          },
          onlineStatus: {
            type: "int32",
            id: 8
          }
        }
      },
      VisitorLoginResult: {
        fields: {
          code: {
            type: "ResultCodeEnum",
            id: 1
          },
          info: {
            type: "string",
            id: 2
          }
        }
      },
      ResultCodeEnum: {
        values: {
          SUCCESS: 0,
          FAILURE: 1,
          ERROR: 2
        }
      },
      VisitorLoginOutResult: {
        fields: {
          visitorId: {
            type: "int32",
            id: 1
          },
          visitorAccid: {
            type: "string",
            id: 2
          },
          visitorCode: {
            type: "string",
            id: 3
          },
          serverId: {
            type: "int32",
            id: 4
          },
          companyId: {
            type: "int32",
            id: 5
          }
        }
      },
      CustomerLogin: {
        fields: {
          visitorCode: {
            type: "string",
            id: 1
          },
          serverid: {
            type: "string",
            id: 2
          },
          isRelogin: {
            type: "bool",
            id: 3
          }
        }
      },
      RequestCmd: {
        oneofs: {
          body: {
            oneof: [
              "visitorLogin",
              "customerLogin"
            ]
          }
        },
        fields: {
          type: {
            type: "RequestType",
            id: 1
          },
          visitorLogin: {
            type: "VisitorLogin",
            id: 2
          },
          customerLogin: {
            type: "CustomerLogin",
            id: 3
          }
        },
        nested: {
          RequestType: {
            values: {
              VISITOR_LOGIN: 0,
              CUSTOMER_LOGIN: 1
            }
          }
        }
      },
      VisitorLogin: {
        fields: {
          visitorAccid: {
            type: "string",
            id: 1
          },
          serverAccid: {
            type: "string",
            id: 2
          },
          isOffLineLogin: {
            type: "bool",
            id: 3
          },
          visitorId: {
            type: "int32",
            id: 4
          },
          serverId: {
            type: "int32",
            id: 5
          }
        }
      },
      Session: {
        fields: {
          id: {
            type: "string",
            id: 1
          },
          unreadCount: {
            type: "int32",
            id: 2
          },
          lastMessage: {
            type: "LastMessage",
            id: 3
          }
        },
        nested: {
          LastMessage: {
            fields: {
              from: {
                type: "string",
                id: 1
              },
              to: {
                type: "string",
                id: 2
              },
              body: {
                type: "string",
                id: 3
              },
              messageType: {
                type: "string",
                id: 4
              }
            }
          }
        }
      },
      WSBaseReqProto: {
        fields: {
          type: {
            type: "int32",
            id: 1
          },
          uid: {
            type: "uint64",
            id: 2
          },
          sid: {
            type: "string",
            id: 3
          }
        }
      },
      WSBaseResProto: {
        fields: {
          type: {
            type: "int32",
            id: 1
          },
          message: {
            type: "WSMessageResProto",
            id: 2
          },
          user: {
            type: "WSUserResProto",
            id: 3
          },
          createTime: {
            type: "string",
            id: 4
          }
        }
      },
      WSMessageResProto: {
        fields: {
          receiveId: {
            type: "uint64",
            id: 1
          },
          msgType: {
            type: "int32",
            id: 2
          },
          msgContent: {
            type: "string",
            id: 3
          }
        }
      },
      WSUserResProto: {
        fields: {
          uid: {
            type: "uint64",
            id: 1
          },
          name: {
            type: "string",
            id: 2
          },
          avatar: {
            type: "string",
            id: 3
          },
          remark: {
            type: "string",
            id: 4
          }
        }
      }
    }
  }
});

module.exports = $root;
